//
//  MBProgressHUD+Custom.m
//  ZuZuBao
//
//  Created by Felix on 2024/4/21.
//

#import "MBProgressHUD+Custom.h"

@implementation MBProgressHUD (Custom)

+ (void)showMessage:(NSString *)message toView:(UIView *)view
{
    [self show:message view:view];
}

+ (void)show:(NSString *)text view:(UIView *)view
{
    if (view == nil) view = [[UIApplication sharedApplication].delegate window];
   
    MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:view animated:YES];
    hud.label.text = text;
    hud.mode = MBProgressHUDModeCustomView;
    
    hud.removeFromSuperViewOnHide = YES;
    
    [hud hideAnimated:YES afterDelay:1.5];
}

@end
